package com.learn.demo.lambda.core4api;

import java.util.function.Function;

/**
 * 函数型接口
 *
 * @author banjiawei
 * @date 2021/06/19
 */
public class FunctionDemo {
    public static void main(String[] args) {
        Function<String, Integer> function = (str) -> str.length();
        Integer len = function.apply("Hello World!");
        System.out.println("'Hello World!'的长度为：" + len);
    }
}
